<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>指定数组-获取对象数据-拎取-pick</title>
    <!-- <script src="https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.21/lodash.min.js"></script> -->
    <script src="lodash.min.js"></script>
    <script src="../helpers/bing.js"></script>
  </head>
  <body>
    <script>
      const a = {
        name: "Alice",
        age: 30,
        email: "alice@example.com",
        phone: "123-456-7890",
      };

      // 示例对象
      const user = a;

      // 使用 pick 提取某些属性
      const result = _.pick(user, ["name", "email"]);

      console.log(result);
      // 输出：{ name: 'Alice', email: 'alice@example.com' }
      console.log(a);
    </script>
  </body>
</html>
